]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ScreenShield: don't lock if the user has no password
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 8 Jun 2013 15:22:43 +0000 (17:22 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 7 Aug 2013 08:33:15 +0000 (10:33 +0200)
If the user has no configured password (like the default user in
a live cd), the behavior should be as if the session was not locked
at all.

https://bugzilla.gnome.org/show_bug.cgi?id=701495

js/ui/screenShield.js

index 89601c0ea441f6cd31c5889f9e73102f7f11272d..4776333ff03a6aeab54977823d23a9dcded0386d 100644 (file)
@@ -1,5 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
+const AccountsService = imports.gi.AccountsService;
 const Cairo = imports.cairo;
 const Clutter = imports.gi.Clutter;
 const Gio = imports.gi.Gio;
@@ -1245,7 +1246,14 @@ const ScreenShield = new Lang.Class({
         St.Clipboard.get_default().set_text(St.ClipboardType.CLIPBOARD, '');
         St.Clipboard.get_default().set_text(St.ClipboardType.PRIMARY, '');
 
-        this._isLocked = true;
+        let userManager = AccountsService.UserManager.get_default();
+        let user = userManager.get_user(GLib.get_user_name());
+
+        if (this._isGreeter)
+            this._isLocked = true;
+        else
+            this._isLocked = user.password_mode != AccountsService.UserPasswordMode.NONE;
+
         this.activate(animate);
 
         this.emit('locked-changed');